Home > Use Cases > Retrieving Schedules

Retrieving Schedules

A sample SessionToken will be used throughout this use case.
The sample SessionToken will be: e65aedeb-a0e7-440c-8309-1cc0bcd920db

The client can ask the API to provide a list of schedules. It can also ask it to provide a list of schedules which are configured to a specific VM. Apart from this, additional parameters can be supplied in order to specify whether only backup schedules, or only sandbox restore schedules should be retrieved. It can also retrieve both backup schedules and sandbox restore schedules in a single call. VMs can also be assigned or un-assigned to a particular schedule.

 

The following GET request retrieves a list of all backup and sandbox restore schedules:

http://localhost:35113/api/schedules/e65aedeb-a0e7-440c-8309-1cc0bcd920db

 

The following GET request retrieves only backup schedules

http://localhost:35113/api/schedules/e65aedeb-a0e7-440c-8309-1cc0bcd920db/1/0

 

The following GET request retrieves only sandbox restore schedules

http://localhost:35113/api/schedules/e65aedeb-a0e7-440c-8309-1cc0bcd920db/0/1

 

The following GET request retrieves all the schedules which are currently assigned to the VM:

http://localhost:35113/api/vms/schedules/e65aedeb-a0e7-440c-8309-1cc0bcd920db/ba2e9cdc-0d85-48e6-8db7-a45c5a40819e

 

Once a ScheduleId has been retrieved by any of the above calls, a VM can be assigned to it. As mentioned above, it is hereby assumed that a VM has already been added to the configuration. The AltaroVirtualMachineRef can be found further up in this document. The ScheduleId that is going to be used for the illustration is the following:

ScheduleId: c76ae50e-498e-4070-97dd-df4d3d08ce9c

 

The following POST request adds a previously configured VM to a schedule:

http://localhost:35113/api/vms/schedules/e65aedeb-a0e7-440c-8309-1cc0bcd920db/ ba2e9cdc-0d85-48e6-8db7-a45c5a40819e/c76ae50e-498e-4070-97dd-df4d3d08ce9c

 

This same call can be altered to a DELETE request and in turn, the VM would be un-assigned from the schedule. This means that if the above POST call is made, and is then followed by a DELETE call, the Altaro VM Backup configuration would return to the same state which it was before the POST request was made.

 

Note: A full list of available API commands can be found here